Call-by-name Gradual Type Theory
نویسندگان
چکیده
We present gradual type theory, a logic and type theory for call-by-name gradual typing. We define the central constructions of gradual typing (the dynamic type, type casts and type error) in a novel way, by universal properties relative to new judgments for gradual type and term dynamism, which were developed in blame calculi and to state the “gradual guarantee” theorem of gradual typing. Combined with the ordinary extensionality (η) principles that type theory provides, we show that most of the standard operational behavior of casts is uniquely determined by the gradual guarantee. This provides a semantic justification for the definitions of casts, and shows that non-standard definitions of casts must violate these principles. Our type theory is the internal language of a certain class of preorder categories called equipments. We give a general construction of an equipment interpreting gradual type theory from a 2-category representing non-gradual types and programs, which is a semantic analogue of Findler and Felleisen’s definitions of contracts, and use it to build some concrete domain-theoretic models of gradual typing. This work is licensed under a Creative Commons “Attribution 4.0 International” license. ∗This material is based upon work supported by the National Science Foundation under grant CCF-1453796. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation. †This research was partially supported by the United States Air Force Research Laboratory under agreement numbers FA-95501210370 and FA-95501510053. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the United States Air Force Research Laboratory, the U.S. Government or Carnegie Mellon University. 1 ar X iv :1 80 2. 00 06 1v 2 [ cs .P L ] 2 3 M ar 2 01 8
منابع مشابه
Induction by Coinduction and Control Operators in Call-by-Name
This paper studies emulation of induction by coinduction in a call-by-name language with control operators. Since it is known that call-by-name programming languages with control operators cannot have general initial algebras, interaction of induction and control operators is often restricted to effect-free functions. We show that some class of such restricted inductive types can be derived fro...
متن کاملGame Theoretic Analysis of Call-by-Value Computation
We present a general semantic universe of call-by-value computation based on elements of game semantics, and validate its appropriateness as a semantic universe by the full abstraction result for call-by-value PCF, a generic typed programming language with call-by-value evaluation. The key idea is to consider the distinction between call-by-name and call-by-value as that of the structure of inf...
متن کاملCall-by-push-value: Decomposing call-by-value and call-by-name
We present the call-by-push-value (CBPV) calculus, which decomposes the typed call-by-value (CBV) and typed call-by-name (CBN) paradigms into fine-grain primitives. On the operational side, we give big-step semantics and a stack machine for CBPV, which leads to a straightforward push/pop reading of CBPV programs. On the denotational side, we model CBPV using cpos and, more generally, using alge...
متن کاملSpace-Efficient Latent Contracts
Standard higher-order contract monitoring breaks tail recursion and leads to space leaks that can change a program’s asymptotic complexity; space-efficiency restores tail recursion and bounds the amount of space used by contracts. Space-efficient contract monitoring for contracts enforcing simple type disciplines (a/k/a gradual typing) is well studied. Prior work establishes a space-efficient s...
متن کاملBridging the ‘Two Cultures’ of Research and Service: Can Complexity Theory Help?; Comment on “Experience of Health Leadership in Partnering With University-Based Researchers in Canada – A Call to ‘Re-imagine’ Research”
This commentary addresses Bowen et al’s empirical study of perspectives of Canadian healthcare staff towards research and their call for multi-faceted action to improve misalignments in the system. This commentary argues that tensions and misalignments between research and service are inherent and can never be eradicated. Building on previous work by Lanham et al, I pro...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- CoRR
دوره abs/1802.00061 شماره
صفحات -
تاریخ انتشار 2018